<div class="title">
	<span>Feedback</span>
	<div class="clear">&nbsp;</div>
</div>

<?php flash(); // display flash data?>
<?php
	if(!empty($feedback)){
	$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="tbl-list" id="tbl-list">' );
	$this->table->set_heading('From', 'Contact', 'Email', 'Message', 'Sent', 'Action');
	$this->table->set_template($tmpl);
	
	foreach($feedback as $v){
		if(!$v->replied) $button = '<a href="'.site_url('admin/reply_feedback/'.$v->id).'" class="btn-icon mail" title="Delete">Reply</a>';
		else $button = 'Already replied to this feedback';
		$data = array(
				$v->customer,
				$v->contact,
				$v->email,
				substr($v->message, 0, 10).'...',
				date('Y-m-d g:i A', strtotime($v->sent)),
				$button
		);
		$this->table->add_row($data);	
	}
	echo $this->table->generate();
	}
	else {
		echo '<div class="msg notice"><span></span><h5>Notice</h5>No feedbacks available yet.</div>';	
	}
?>

